package com.stox.client.ui.javafx.navigator.application;

import com.stox.client.ui.core.application.AbstractApplication;
import com.stox.client.ui.javafx.navigator.view.NavigatorView;
import com.stox.client.ui.javafx.navigator.widget.NavigatorContextMenu;
import com.stox.shared.core.i18n.MessageSource;

public class NavigatorApplication extends AbstractApplication {
	
	public static final NavigatorApplication INSTANCE = new NavigatorApplication();
	
	private NavigatorView navigatorView;
	private NavigatorContextMenu navigableContextMenu;
	
	private NavigatorApplication() {
	}
	
	@Override
	public String getName() {
		return MessageSource.get("Navigator");
	}

	@Override
	public void show() {
		super.show();
		if(null == navigatorView){
			navigatorView = new NavigatorView();
			navigableContextMenu = new NavigatorContextMenu(navigatorView.getNavigableScripListView());
			navigatorView.getNavigableScripListView().setContextMenu(navigableContextMenu);
		}
		navigatorView.open();
	}

	@Override
	public void hide() {
		super.hide();
		navigatorView.close();
	}

}
